x86: Fix host S3.
authorKeir Fraser <keir.fraser@citrix.com>
Fri, 25 Jan 2008 13:26:38 +0000 (13:26 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Fri, 25 Jan 2008 13:26:38 +0000 (13:26 +0000)
Time zone info just needs to be calculated in S3 suspend procedure.
However, time_suspend() is also called on AP. That wasteful
get_cmos_time() on AP may break __cpu_die() assumption since
get_cmos_time() can take up to one second. This fix just limits it to
running on the BSP.

Signed-off-by: Xu Dongxiao <dongxiao.xu@intel.com>
xen/arch/x86/time.c

index 6d4946245bd08a8419202be26ded212a11913436..3793c4bb2cbb58c98447ad7c1e07e99016c9ad41 100644 (file)
@@ -976,8 +976,11 @@ static long cmos_utc_offset; /* in seconds */
 
 int time_suspend(void)
 {
-    cmos_utc_offset = (wc_sec + (wc_nsec + NOW()) / 1000000000ULL)
-        - get_cmos_time();
+    if ( smp_processor_id() == 0 )
+    {
+        cmos_utc_offset = -get_cmos_time();
+        cmos_utc_offset += (wc_sec + (wc_nsec + NOW()) / 1000000000ULL);
+    }
 
     /* Better to cancel calibration timer for accuracy. */
     kill_timer(&this_cpu(cpu_time).calibration_timer);